/**
 * 
 */
package net.homelinux.ajay.net.ondisk.client;


import net.homelinux.ajay.net.ondisk.view.client.AppTree;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.EventListener;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.NamedFrame;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * @author ajay
 *
 */
public class AppPanel extends VerticalPanel implements EventListener {

  private VerticalPanel app;
  private HTML center;
  private PropertyPanel prop;
  private AppTree tree;

  /**
   * 
   */
  public AppPanel() {
    init();
  }

  private void init() {
    //this.setBorderWidth(1);
    setHeight("100%");
    setWidth("100%");
    app = new VerticalPanel();
    add(app);
    //app.setWidth("100%");
//    Panel treepanel=makeTreePanel();
    
//    add(left, WEST);
    center = new HTML("<hr/>");
    center.setWidth("100%" );
    center.setHeight("1px");
    center.addStyleName("slider");
    //    add(center,CENTER);

    tree = AppTree.makeTree(app,this);
    //app.add(tree);
//    browser = new NamedFrame("browser");
//    //center.add(new Label("Center"));
//    browser.setSize("100%", "100%");
//    center.add(browser);
//    browser.setUrl("http://www.google.com/");
    add(center);
    
    prop = new PropertyPanel();
    add(prop);
    
  }

  private Panel makeTreePanel() {
    Panel treepanel;
    treepanel = new ScrollPanel();
    //treepanel.setHeight("100%");
    //treepanel.setWidth("10em");
    app.add(treepanel);
    return treepanel;
  }

  public PropertyPanel getPropertyPanel() {
    return prop;
  }


}
